Skip to main content

XPDFViewer_Image

Type

command

Summary

This command sets the value of a named variable to the imageData of the rendered page.

Syntax

XPDFViewer_Image <viewerName>, <pageNumber>, <variableName>

Description

This command sets the value of a named variable to the imageData of the rendered page. The page is rendered at the current viewer scale. LiveCode imageData does not contain any width or height information so you must set the width and height of the image correctly before setting the imageData. The command returns the size (width, height) of the image. As the image is drawn at the current scale of the PDF view the width/height returned will not match the width/height calculated from XPDFViewer_Get(\"Document1\",\"width\") and XPDFViewer_Get(\"Document1\",\"height\") on Mac retina and high DPI windows systems.

The following errors may be thrown by the command:

  • XPDF_ERROR: incorrect number of parameters
  • XPDF_ERROR: PDF viewer not found

Parameters

NameTypeDescription

viewerName

string

The name of the viewer.

pageNumber

integer

The pageNumber to return the image of.

variableName

string

The name of the variable to set to the image data of the page.

Examples

local tImageData
XPDFViewer_Image "Document1", 1, "tImageData"
put the result into tSize
set the width of image "page" to item 1 of tSize
set the height of image "page" to item 2 of tSize
set the imageData of image "page" to tImageData

Compatibility and Support

Introduced

LiveCode 1.0.0

OS

mac

windows

Platforms

desktop

Thank you for your feedback!

Was this page helpful?